<template>
  <view>
    <navbar></navbar>
    <view class="agreement">
      <mp-html :content="agreement"></mp-html>
    </view>
  </view>
</template>

<script>
const app = getApp();
import navbar from "@/components/navbar/navbar";

export default {
  components: {
    navbar
  },
  data() {
    return {
		agreement: ''
    }
  },
  onLoad(options) {
    this.type = options.type;
	this.title = options.title;
    this.requestData();
  },
  onReady() {
  	uni.setNavigationBarTitle({
  		title: this.title
  	})
  },
  methods: {
    requestData() {
      app._get('user/registerrule', {
		  type: this.type
	  }, (res) => {
        this.agreement = this.escape2Html(res.data);
      })
    }
  }
}
</script>

<style lang="scss" scoped>
	.agreement {
		padding: 20rpx;
	}
</style>
